package com.zwb.service.enums;

/**
 * @author 头发又黑又长
 * @Date 2022/8/26 20:10
 * @email zwb15083976291@163.com
 */


public enum StatusCode {
    SUCCESS(20000, "操纵成功"),
    NO_LOGIN(40001, "用户未登录"),
    NOT_FOUND(40004, "资源不存在"),
    AUTHORIZED(40003, "没有操作权限"),
    SYSTEM_ERROR(50000, "系统异常"),
    FAIL(51000, "操作失败"),
    VALID_ERROR(52000, "参数格式不正确"),
    USERNAME_EXIST(52001, "用户名已存在"),
    USERNAME_NOT_EXIST(52002, "用户名不存在"),
    SERVICE_UNAVAILABLE(50003, "服务正忙,请稍候再试");

    private final long code;
    private final String message;

    StatusCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    public long getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "StatusCode{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
